package br.com.SAM.Cliente;

import java.util.Properties;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;



public class Cliente {
	
	public static Object gerarCliente(String nome){
		Properties p = new Properties();  
		 p.setProperty(Context.INITIAL_CONTEXT_FACTORY,  
		         "org.jnp.interfaces.NamingContextFactory");  
		p.setProperty(Context.PROVIDER_URL, "127.0.0.1:1099");  
		p.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming"); 
		try {
			InitialContext ic = new InitialContext(p);
			Object o = ic.lookup(nome);
			
			return o;
		} catch (NamingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;

	}

}
